package demo3;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
    UserDAO user =new UserDAO();
    System.out.println(user);

    AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext("demo3");
    UserDAO user1=context.getBean(UserDAO.class);
    System.out.println(user1);

    Person p=new Person();
    p.setName("刘界");
    p.setAge(21);
    System.out.println(p);

    Person p1=context.getBean(Person.class);
    System.out.println(p1);
    }
}
